package com.mew.slots.core.game.tgg.room;

import com.mew.slots.core.common.game.BaseRoom;
import com.mew.slots.core.game.tgg.dto.TggPlayMsgs;

import java.util.ArrayList;

public class TggRoom extends BaseRoom {

    public int _FREE = 9;
    public int freeRate;

    public TggRoom(int freeRate){
        this.freeRate=freeRate;
        res = new TggPlayMsgs();
        row = 3;
        col = 5;
        _WILD = 8;
        spes = new ArrayList<Integer>(){{
            add(9);
        }};
        rate = new int[][]{
                 {0, 0,10,20,100}, //J 0
                 {0, 0,10,20,100}, //Q 1
                 {0, 0,15,30,125}, //K 2
                 {0, 0,15,30,125}, //A 3
                 {0, 0,30,100,200}, //啤酒 4
                 {0, 0,40,100,250}, //果饮 5
                 {0, 0,50,150,300}, //耳机 6
                 {0, 0,75,150,400}, //DJ 7
                 {0, 0,0,0,0},  //W 8
                 {0, 0,0,0,0},//U 9
        };
    }


    @Override
    public void freeBouns(){
        computFeee();
    }
    private void computFeee(){
        TggPlayMsgs tggRes=(TggPlayMsgs) res;
        //5列都有免费图标
        //进免费
        if(llx(_FREE,0,1,2,3,4)){
            tggRes.setFree((byte)1);
            tggRes.setFreeNumber(12);
            int freeNum=fsdb(_FREE);
            if(freeNum==6){
                tggRes.setFreeType(2);
            }else if(freeNum>=7){
                tggRes.setFreeType(3);
            }else{
                tggRes.setFreeType(1);
            }
        }
        //有免费
        if(free){
            tggRes.setMultiple(tggRes.getMultiple()*freeRate);
        }
    }

    @Override
    public int[] control(){
        switch (controlType) {
            case 1:
                return iliXml.getSpeints("21-23",in);
            case 2:
                return iliXml.getSpeints("minfree",in);
            default:
                return iliXml.getSpeints("0-0",in);
        }
    }

}
